package com.felix.util;

import java.util.HashMap;
import java.util.Map;

import com.g3net.tool.CTime;
import com.g3net.tool.HttpUtils;

public class SmsUtil {
	public static String SENDURL="http://61.143.160.150:8080/smshttp?act=sendmsg&unitid=1436&username=huang&passwd=123456&port=";
	public static String sendSms(String pwd,String mobi){
		String res=null;
		Map<String, String> param=new HashMap<String, String>();
		String msg="尊敬的用户您好，欢迎体验顺顺客户端，您本次验证码为【"+pwd+"】50秒内验证有效，谢谢。";
		String dateT=CTime.formatWholeDate();
//		StringBuffer sb=new StringBuffer(SENDURL);
//		sb.append("&msg=");
//		sb.append(msg);
//		sb.append("&phone=");
//		sb.append(mobi);
//		sb.append("&sendtime=");
//		sb.append(dateT);
		param.put("msg", msg);
		param.put("phone", mobi);
		param.put("sendtime", dateT);
		try {
			res=HttpUtils.post(SENDURL, param, "GBK",
			"GBK");
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
		
		return res;
	}
	public static void main(String[] args) {
		System.out.println(CTime.formatWholeDate());
	}

}
